package org.eclipse.mylyn.rememberthemilk.ui;

import java.util.HashSet;
import java.util.Set;

import org.eclipse.mylyn.rememberthemilk.core.RTMCorePlugin;
import org.eclipse.mylyn.rememberthemilk.core.RTMRepositoryQuery;
import org.eclipse.mylyn.rememberthemilk.core.model.RTMTask;
import org.eclipse.mylyn.tasks.core.AbstractTaskListMigrator;
import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
import org.eclipse.mylyn.tasks.core.ITask;
import org.w3c.dom.Element;

public class RTMTaskListMigrator extends AbstractTaskListMigrator {

	private static final String KEY_RTM = "RememberTheMilk";

	private static final String KEY_RTM_TASK = KEY_RTM + AbstractTaskListMigrator.KEY_TASK;

	private static final String KEY_RTM_QUERY = KEY_RTM + AbstractTaskListMigrator.KEY_QUERY;

	@Override
	public String getTaskElementName() {
		return KEY_RTM_TASK;
	}

	@Override
	public Set<String> getQueryElementNames() {
		Set<String> names = new HashSet<String>();
		names.add(KEY_RTM_QUERY);
		return names;
	}


//	public boolean canCreate(AbstractTask task) {
//		return task instanceof RTMTask;
//	}
//
//
//	public boolean canCreate(AbstractRepositoryQuery category) {
//		return category instanceof RTMRepositoryQuery;
//	}
//
//
//	public String getQueryElementName(AbstractRepositoryQuery query) {
//		return query instanceof RTMRepositoryQuery ? KEY_RTM_QUERY : "";
//	}
//
//
//	public AbstractTask createTask(String repositoryUrl, String taskId, String summary, Element element) {
//		return new RTMTask(repositoryUrl, taskId, summary);
//	}
//
//
//	public AbstractRepositoryQuery createQuery(String repositoryUrl, String queryString, String label, Element element) {
//		return new RTMRepositoryQuery(repositoryUrl, queryString, label);
//	}

	@Override
	public String getConnectorKind() {
		return RTMCorePlugin.REPOSITORY_KIND;
	}

	@Override
	public void migrateQuery(IRepositoryQuery query, Element element) {
		// TODO add print to figure out what does this
		
	}

	
	@Override
	public void migrateTask(ITask task, Element element) {
		// TODO add print to figure out what does this
		// i think i got to add id's here
		// also need to add modification time probably
	}

}
